<template>
  <gl-page @onRefresh="getData">
    <!-- 自定义下拉刷新view -->
    <template #top>
      <view>
        <uv-button type="primary" text="点击" @click="increment"></uv-button>
        <uv-button type="primary" text="reset" @click="reset"></uv-button>
        <view>{{ count }}</view>
      </view>
    </template>
  </gl-page>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import { useUserStore } from '@/stores/user'


const store = useUserStore()
const { count } = storeToRefs(store)
const { increment, reset } = store

function getData(stopPullDown) {
  setTimeout(() => {
    increment()
    stopPullDown();
  }, 1000)
}



</script>

<style scoped></style>